Repository navigation
feat: connect Ollama, vLLM and llama.cpp on the same server - #6
Conversation
- Connect Local Models action: opt in to each installed backend; each becomes an optional dependency while connected and installed - main.ts resolves each backend's bridge address and its public credentials reactively and hands OpenCode the providers in OPENCODE_CONFIG_CONTENT, never in opencode.json - Ollama goes through OpenCode's built-in Ollama provider for live model discovery; vLLM serves the model it publishes, with tool calling on; llama.cpp is one model that llama-server answers with whatever it serves - a `mounts` volume, not backed up, holds the backends' mounted public volumes - Configure Model Providers reserves the ids ollama, vllm and llama-cpp - README, instructions and release notes cover the integrations Co-Authored-By: Claude Opus 5.5 <[email protected]>
helix-white
left a comment
There was a problem hiding this comment.
Three correctness fixes proposed:
-
P2 — Invalidate disconnected credential mounts (
startos/localModels.ts:164). After connecting vLLM or llama.cpp, disconnect it, uninstall/reinstall it, then reconnect at the same bridge address. The disconnected branch skips both address watches andreadCredentials, leavingmountedForunchanged. Reconnection skips the mount and reads the old/empty volume instead of the replacement credentials. The proposal drops the cached entry when disconnected, forcing a remount on reconnection. -
P2 — Reject existing provider-ID collisions before saving (
startos/actions/connectLocalModels.ts:52). The previous provider action explicitly suggestedvllm, so an existing remote provider with that ID is reachable. Connecting local vLLM replaces its effective URL/key but retains the earlier models and default: OpenCode folds same-ID providers rather than replacing them (upstream implementation). Those remote model IDs then target the local server and fail. Reserving future form IDs does not handle existing configuration. The proposal rejects the connection without saving and explains how to rename/remove the old entry, with translated feedback and matching docs. -
P2 — Keep incompatible installed backends visible as dependencies (
startos/dependencies.ts:20–24). For example, llama.cpp before11960:1has noapi-keyhost. It is offered by Connect Local Models, but its missing address makesenabledfalse, suppressing the very version warning that would explain why no model appears. The proposal checks installed-manifest presence independently of API availability; uninstall still disables the dependency.
The reviewed head merges cleanly with master; all three current CI checks passed. I inspected the published SDK and pinned upstream provider semantics without building or running the change. The proposal is untested; please verify the disconnect/reinstall/reconnect flow, collision rejection, and an older backend's update warning when adopting it.
Proposed changes: 1be68ed...proposal/6
To adopt the proposal, cherry-pick it onto your branch rather than merging or pulling it, so the PR's head stays your own commit:
git fetch https://github.com/Start9-Community/opencode-startos.git proposal/6
git cherry-pick 1be68ed36212da730bcbb109c8315ba89e547fec..FETCH_HEADIf your branch has moved since 1be68ed36212da730bcbb109c8315ba89e547fec, resolve any conflicts the cherry-pick reports, or apply the changes your own way. Then push and say so in a comment.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Review and proposed fixes are published above; I did not change this PR’s branch. The final-review handoff failed because @MattDHill is both the configured final reviewer and the PR author, so GitHub rejects that review request. This Helix limitation is tracked at https://github.com/Start9Labs/helix-startos-internal/issues/213. |
… backends visible - drop a disconnected backend's cached mount, so reconnecting after a reinstall reads the new credentials - Connect Local Models refuses a backend whose id is already a provider in opencode.json - a connected backend counts as a dependency while it is installed, so an incompatible version shows its warning Co-Authored-By: helix-white <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
helix-red
left a comment
There was a problem hiding this comment.
The head is unchanged since @helix-white’s review. I independently confirmed its three P2 findings; the existing published proposal addresses them and can be adopted as-is:
- Invalidate credential mounts on disconnect —
startos/localModels.ts:164. Disconnecting skips the address and credential watches without clearingmountedFor. If the backend is uninstalled/reinstalled while disconnected and returns at the same address, reconnecting reads the obsolete mount rather than the replacement public volume. Clear its cached mount identity on disconnect. - Reject existing provider-ID collisions before saving —
startos/actions/connectLocalModels.ts:52. Existing configurations can usevllm(the previous form’s example). OpenCode 2.4.1 overlays same-ID providers, retaining earlier models/settings, so connecting local vLLM redirects those remote models to the local endpoint. Reserving future IDs does not repair existing entries. Reject the connection without saving and explain how to rename/remove the conflicting entry. - Track installed dependencies independently of API availability —
startos/dependencies.ts:20–24. A selected older llama.cpp release without the Bearer API host resolves no address, disabling the dependency and hiding its version warning. Use reactive manifest presence for dependency activation; reserve address availability for effective provider generation.
The proposal records these contracts at their production owners and updates the user documentation and translations. I read the full diff, the published SDK 4.1.0 implementations, backend contracts, and the pinned upstream provider overlay/discovery code. The head merges cleanly with master; all three current CI checks passed. No builds or tests were run for this review. The author should verify the proposed disconnect/reinstall/reconnect behavior, collision rejection, and incompatible-backend warning.
Proposed changes: 1be68ed...proposal/6
To adopt the proposal, cherry-pick it onto your branch rather than merging or pulling it, so the PR’s head stays your own commit:
git fetch https://github.com/Start9-Community/opencode-startos.git proposal/6
git cherry-pick 1be68ed36212da730bcbb109c8315ba89e547fec..FETCH_HEADIf your branch has moved since 1be68ed36212da730bcbb109c8315ba89e547fec, resolve any conflicts the cherry-pick reports, or apply the changes your own way. Then push and say so in a comment.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
My review confirms the three existing findings and endorses the published proposal; I did not change the PR branch or replace the proposal. Final-review handoff is still blocked because GitHub cannot request a review from the PR author (@MattDHill), who is also the configured final reviewer. This is already tracked in https://github.com/Start9Labs/helix-startos-internal/issues/213. |
|
The head remains 1be68ed and still merges cleanly with master. @helix-red confirmed the same three findings, so my existing changes-requested verdict and proposal/6 stand. No further code changes or review requests from me; this is awaiting the author’s response/adoption and verification. |
|
Adopted
|
helix-white
left a comment
There was a problem hiding this comment.
All three prior findings are resolved. The new head's tree exactly matches proposal/6: disconnect invalidates the credential-mount cache, existing provider-ID collisions fail before saving, and dependency activation watches installed-manifest presence independently of API availability. The contracts, translations and user documentation match the fixes. It merges cleanly with master.
The author reports successful collision-rejection and disconnect/reinstall/reconnect tests, plus passing typecheck and formatting. The older-backend warning and a real vLLM completion remain explicitly untested. Current-head matrix discovery passed; x86 and ARM builds are still running. I ran no builds or tests for this re-review. No remaining blocking findings.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
helix-red
left a comment
There was a problem hiding this comment.
All three prior findings are resolved. I reviewed the changes since 1be68ed and confirmed this head's tree exactly matches the published proposal: disconnect clears the credential-mount cache, existing provider-ID collisions reject before saving, and installed-manifest presence keeps incompatible connected backends visible independently of API availability. The production contracts, translations and documentation match those fixes.
The head merges cleanly with master; all three current CI checks passed. The author reports successful collision rejection and disconnect/reinstall/reconnect tests, plus passing typecheck and formatting. The older-backend warning and a real vLLM completion remain explicitly untested. I ran no builds or tests for this re-review. No remaining blocking findings.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Both Helix identities have approved the unchanged head 453f158. All three current CI checks now pass, including x86 and ARM builds, and it still merges cleanly with master. My existing approval stands; I am not issuing another reciprocal review request. @MattDHill, this is ready for your maintainer decision; the native final-review request remains unavailable because you authored the PR. |
Lets OpenCode use models served by Start9's Ollama, vLLM and llama.cpp packages on the same server, so a fully self-hosted setup needs no outside provider.
How it works
store.json. Each becomes an optionalrunningdependency while it is connected and installed.startos/localModels.tsresolves each connected backend's bridge address with.const(), and for vLLM and llama.cpp mounts itspublicvolume onto a newmountsvolume, which isn't backed up, to readcredentials.json.main.tshands OpenCode the resulting providers inOPENCODE_CONFIG_CONTENT, a config layer OpenCode merges over the global file.opencode.jsonis never written. A backend that isn't resolvable is left out, and.const()restarts OpenCode when it appears.ollama,settings.baseURLonly). That plugin discovers the pulled models every 30 seconds, along with each one's tool and vision support.credentials.json→model, since vLLM 0.33.0:1). Switching models in vLLM restarts OpenCode onto the new one. Tool calling is set on explicitly: OpenCode's built-in vLLM plugin marks discovered models tool-less, but every vLLM preset serves with a tool-call parser, and config model overrides apply after the plugins.llama-cpp/current. llama-server serves a single model and answers whatever model name it is sent.ollama,vllmandllama-cpp. Its field example changes fromvllmtolab.2.4.1:2, which community-prod has never served. Its release notes become the first release's notes.Verified on a StartOS 0.4.3 box (x86_64, CPU only)
qwen3:0.6b: after connecting, OpenCode listed the model withtools: trueand a 40,960-token context. A session onollama/qwen3:0.6bmade awritetool call that created the file with the requested content.llama-32-1bpreset: the key was read from the mountedpublicvolume. A session onllama-cpp/currentmade a tool call that wrote the file, so llama-server accepts the fixed model name.Qwen/Qwen2.5-0.5B-Instructwith a tool-call parser: OpenCode received the provider with the published key and model andtools: true. vLLM itself never finished starting on this CPU-only box, its own health check failing after 35 minutes, so a real vLLM completion is untested. While vLLM accepted connections without answering, OpenCode's/api/configand/api/modelstalled for up to 30 seconds; both returned in about a second once vLLM stopped.vllmwithout writing anything.tscand Prettier pass. The two low-severitynpm auditfindings arefast-xml-parserinside the SDK and also present onmaster.review effort: 'xhigh'
model: claude-opus-5-5
🤖 Generated with Claude Code